﻿<template>
  <div class="nsw-container">
    <div class="left">
      <el-menu  :default-active="$route.path" router select="selectMenu">
        <el-submenu index="1">
          <template slot="title">
            <i class="el-icon-user"></i>
            <span>我的服装设计</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/person/auth" route="/person/auth" >用户认证</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="2">
          <template slot="title">
            <i class="el-icon-setting"></i>
            <span>系统设置</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/person/info" route="/person/info" >个人信息</el-menu-item>
          </el-menu-item-group>
          <el-menu-item-group>
            <el-menu-item index="/person/account" route="/person/account" >个人设置</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
      </el-menu>
    </div>
    <div class="right">
      <el-card class="box-card" shadow="always">
        <keep-alive >
          <router-view :key="key" />
        </keep-alive>
      </el-card>
    </div>
  </div>
</template>

<script>
export default {
  name: "Person",
  data() {
    return {
      isCollapse: true
    };
  },
  methods: {
    selectMenu(index,indexPath){
      console.log(index, indexPath);
    }
  },
  computed: {
    key() {
      return this.$route.path;
    },
  },
}
</script>

<style scoped>
.nsw-container{
  width: 100%;
  height: calc(100vh - 270px);
  display: flex;
}
.left{
  width: 20%;
  height: 100%;
  border-right: solid 1px #e6e6e6;
}
.right{
  width: 80%;
  height: 100%;
}
.box-card{
  height: 95%;
  margin: 1%;
}
</style>
